<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('查看HBase表数据详情')" />
    <th:block th:include="include :: jsonview-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-data-edit" th:object="${sysHbaseTableData}">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">row key：</label>
                <div class="col-sm-8">
                    <input name="rowKey" th:field="*{rowKey}" class="form-control" type="text" readonly>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">列簇名称：</label>
                <div class="col-sm-8">
                    <input name="familyName" th:field="*{familyName}" class="form-control" type="text" readonly>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">时间戳：</label>
                <div class="col-sm-8">
                    <input name="timestamp" th:field="*{timestamp}" class="form-control" type="text" readonly>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">数据值：</label>
                <div class="col-sm-8">
                    <div class="form-control-static"><pre id="dataValue"></pre></div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: jsonview-js" />

    <script th:inline="javascript">
        var prefix = ctx + "system/data";
        $("#form-data-edit").validate({
            focusCleanup: true
        });

        $(function() {
            var dataValue = [[${sysHbaseTableData.value}]];

            if ($.common.isNotEmpty(dataValue) && dataValue.length < 2000) {
                try {
                    $("#dataValue").JSONView(dataValue);
                }catch (e) {
                    $("#dataValue").text(dataValue);
                }
            } else {
                $("#dataValue").text(dataValue);
            }
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-data-edit').serialize());
            }
        }
    </script>
</body>
</html>